A database is a collection of logically related data arranged in a predetermined format, such as in tables that contain rows and columns. To access the content of a table in the database, queries according to a standard database query language (such as the Structured Query Language or SQL) are submitted to the database. A query can be issued to insert new entries into a table of a database (such as to insert a row into the table), modify the content of the table, or to delete entries from the table. Examples of SQL statements include INSERT, SELECT, UPDATE, and DELETE.
In a relational database management system, ordered analytic functions are often used, where an ordered analytic function refers to a function that contains an order specification (specifying an order based on one or more attributes, e.g., sorting based on the one or more attributes) or an expression that performs some predetermined analysis, such as ranking, computing a moving average within some window size, calculating a cumulative total, calculating a percentile, and so forth.
SQL defines a PARTITION BY clause that allows such ordered analytic functions to be computed on multiple distinct partitions of the data determined by the value of one or more columns contained in the PARTITION BY clause. However, the partitions defined by the PARTITION BY clause are static partitions, which provide relatively limited flexibility.